package com.playmodule.vr.projections;

public class PlaneProjection
  extends Projection
{
  private static final int DEPTH = 10;
  private static final int HEIGHT = 8;
  private static final float WIDTH = 8.0F;
  
  public PlaneProjection(int paramInt, float paramFloat, boolean paramBoolean)
  {
    this.mAmbilight = paramBoolean;
    this.mAspectRatio = paramFloat;
    setupProjection(paramInt);
  }
  
  private float[] genVertices(float paramFloat)
  {
    float[] arrayOfFloat = new float[60];
    arrayOfFloat[0] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[1] = -8.0F;
    arrayOfFloat[2] = 2058.0F;
    arrayOfFloat[3] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[4] = -8.0F;
    arrayOfFloat[5] = 2058.0F;
    arrayOfFloat[6] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[7] = -8.0F;
    arrayOfFloat[8] = -10.0F;
    arrayOfFloat[9] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[10] = -8.0F;
    arrayOfFloat[11] = -10.0F;
    arrayOfFloat[12] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[13] = -8.0F;
    arrayOfFloat[14] = -10.0F;
    arrayOfFloat[15] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[16] = -8.0F;
    arrayOfFloat[17] = -10.0F;
    arrayOfFloat[18] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[19] = 8.0F;
    arrayOfFloat[20] = -10.0F;
    arrayOfFloat[21] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[22] = 8.0F;
    arrayOfFloat[23] = -10.0F;
    arrayOfFloat[24] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[25] = -8.0F;
    arrayOfFloat[26] = -10.0F;
    arrayOfFloat[27] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[28] = -8.0F;
    arrayOfFloat[29] = 2058.0F;
    arrayOfFloat[30] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[31] = 8.0F;
    arrayOfFloat[32] = 2058.0F;
    arrayOfFloat[33] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[34] = 8.0F;
    arrayOfFloat[35] = -10.0F;
    arrayOfFloat[36] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[37] = 8.0F;
    arrayOfFloat[38] = -10.0F;
    arrayOfFloat[39] = (paramFloat - 8.0F * this.mAspectRatio);
    arrayOfFloat[40] = 8.0F;
    arrayOfFloat[41] = 2058.0F;
    arrayOfFloat[42] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[43] = 8.0F;
    arrayOfFloat[44] = 2058.0F;
    arrayOfFloat[45] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[46] = 8.0F;
    arrayOfFloat[47] = -10.0F;
    arrayOfFloat[48] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[49] = -8.0F;
    arrayOfFloat[50] = -10.0F;
    arrayOfFloat[51] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[52] = 8.0F;
    arrayOfFloat[53] = -10.0F;
    arrayOfFloat[54] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[55] = 8.0F;
    arrayOfFloat[56] = 2058.0F;
    arrayOfFloat[57] = (paramFloat + 8.0F * this.mAspectRatio);
    arrayOfFloat[58] = -8.0F;
    arrayOfFloat[59] = 2058.0F;
    return arrayOfFloat;
  }
  
  private float[] genVerticesStereo(float paramFloat)
  {
    return concat(genVertices(65536.0F), genVertices(-65536.0F));
  }
  
  private void generatePlaneMono()
  {
    float[] arrayOfFloat1 = new float[12];
    arrayOfFloat1[0] = (8.0F * this.mAspectRatio);
    arrayOfFloat1[1] = -8.0F;
    arrayOfFloat1[2] = -10.0F;
    arrayOfFloat1[3] = (-8.0F * this.mAspectRatio);
    arrayOfFloat1[4] = -8.0F;
    arrayOfFloat1[5] = -10.0F;
    arrayOfFloat1[6] = (-8.0F * this.mAspectRatio);
    arrayOfFloat1[7] = 8.0F;
    arrayOfFloat1[8] = -10.0F;
    arrayOfFloat1[9] = (8.0F * this.mAspectRatio);
    arrayOfFloat1[10] = 8.0F;
    arrayOfFloat1[11] = -10.0F;
    short[] arrayOfShort = new short[6];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    float[] arrayOfFloat2 = { 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F };
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
  
  private void generatePlaneMonoAmbilight()
  {
    float[] arrayOfFloat1 = genVertices(0.0F);
    short[] arrayOfShort = new short[30];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    arrayOfShort[6] = 4;
    arrayOfShort[7] = 5;
    arrayOfShort[8] = 6;
    arrayOfShort[9] = 6;
    arrayOfShort[10] = 7;
    arrayOfShort[11] = 4;
    arrayOfShort[12] = 8;
    arrayOfShort[13] = 9;
    arrayOfShort[14] = 10;
    arrayOfShort[15] = 10;
    arrayOfShort[16] = 11;
    arrayOfShort[17] = 8;
    arrayOfShort[18] = 12;
    arrayOfShort[19] = 13;
    arrayOfShort[20] = 14;
    arrayOfShort[21] = 14;
    arrayOfShort[22] = 15;
    arrayOfShort[23] = 12;
    arrayOfShort[24] = 16;
    arrayOfShort[25] = 17;
    arrayOfShort[26] = 18;
    arrayOfShort[27] = 18;
    arrayOfShort[28] = 19;
    arrayOfShort[29] = 16;
    float[] arrayOfFloat2 = { 1.0F, 0.1F, 0.0F, 0.1F, 0.0F, 0.0F, 1.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, 0.0F, 0.1F, 0.0F, 0.1F, 1.0F, 0.0F, 1.0F, 0.0F, 1.0F, 0.0F, 0.9F, 1.0F, 0.9F, 1.0F, 1.0F, 1.0F, 0.0F, 1.0F, 1.0F, 0.9F, 1.0F, 0.9F, 0.0F };
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
  
  private void generatePlaneOverUnder()
  {
    float[] arrayOfFloat1 = new float[24];
    arrayOfFloat1[0] = (8.0F * this.mAspectRatio - 65536.0F);
    arrayOfFloat1[1] = -8.0F;
    arrayOfFloat1[2] = -10.0F;
    arrayOfFloat1[3] = (-8.0F * this.mAspectRatio - 65536.0F);
    arrayOfFloat1[4] = -8.0F;
    arrayOfFloat1[5] = -10.0F;
    arrayOfFloat1[6] = (-8.0F * this.mAspectRatio - 65536.0F);
    arrayOfFloat1[7] = 8.0F;
    arrayOfFloat1[8] = -10.0F;
    arrayOfFloat1[9] = (8.0F * this.mAspectRatio - 65536.0F);
    arrayOfFloat1[10] = 8.0F;
    arrayOfFloat1[11] = -10.0F;
    arrayOfFloat1[12] = (65536.0F + 8.0F * this.mAspectRatio);
    arrayOfFloat1[13] = -8.0F;
    arrayOfFloat1[14] = -10.0F;
    arrayOfFloat1[15] = (65536.0F + -8.0F * this.mAspectRatio);
    arrayOfFloat1[16] = -8.0F;
    arrayOfFloat1[17] = -10.0F;
    arrayOfFloat1[18] = (65536.0F + -8.0F * this.mAspectRatio);
    arrayOfFloat1[19] = 8.0F;
    arrayOfFloat1[20] = -10.0F;
    arrayOfFloat1[21] = (65536.0F + 8.0F * this.mAspectRatio);
    arrayOfFloat1[22] = 8.0F;
    arrayOfFloat1[23] = -10.0F;
    short[] arrayOfShort = new short[12];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    arrayOfShort[6] = 4;
    arrayOfShort[7] = 5;
    arrayOfShort[8] = 6;
    arrayOfShort[9] = 6;
    arrayOfShort[10] = 7;
    arrayOfShort[11] = 4;
    float[] arrayOfFloat2 = { 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F, 0.5F, 0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F };
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
  
  private void generatePlaneSideBySide()
  {
    float[] arrayOfFloat1 = new float[24];
    arrayOfFloat1[0] = (8.0F * this.mAspectRatio - 65536.0F);
    arrayOfFloat1[1] = -8.0F;
    arrayOfFloat1[2] = -10.0F;
    arrayOfFloat1[3] = (-8.0F * this.mAspectRatio - 65536.0F);
    arrayOfFloat1[4] = -8.0F;
    arrayOfFloat1[5] = -10.0F;
    arrayOfFloat1[6] = (-8.0F * this.mAspectRatio - 65536.0F);
    arrayOfFloat1[7] = 8.0F;
    arrayOfFloat1[8] = -10.0F;
    arrayOfFloat1[9] = (8.0F * this.mAspectRatio - 65536.0F);
    arrayOfFloat1[10] = 8.0F;
    arrayOfFloat1[11] = -10.0F;
    arrayOfFloat1[12] = (65536.0F + 8.0F * this.mAspectRatio);
    arrayOfFloat1[13] = -8.0F;
    arrayOfFloat1[14] = -10.0F;
    arrayOfFloat1[15] = (65536.0F + -8.0F * this.mAspectRatio);
    arrayOfFloat1[16] = -8.0F;
    arrayOfFloat1[17] = -10.0F;
    arrayOfFloat1[18] = (65536.0F + -8.0F * this.mAspectRatio);
    arrayOfFloat1[19] = 8.0F;
    arrayOfFloat1[20] = -10.0F;
    arrayOfFloat1[21] = (65536.0F + 8.0F * this.mAspectRatio);
    arrayOfFloat1[22] = 8.0F;
    arrayOfFloat1[23] = -10.0F;
    short[] arrayOfShort = new short[12];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    arrayOfShort[6] = 4;
    arrayOfShort[7] = 5;
    arrayOfShort[8] = 6;
    arrayOfShort[9] = 6;
    arrayOfShort[10] = 7;
    arrayOfShort[11] = 4;
    float[] arrayOfFloat2 = { 1.0F, 0.0F, 0.5F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F, 0.5F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F };
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
  
  private void generatePlaneSideBySideAmbilight()
  {
    float[] arrayOfFloat1 = genVerticesStereo(65536.0F);
    short[] arrayOfShort = new short[60];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    arrayOfShort[6] = 4;
    arrayOfShort[7] = 5;
    arrayOfShort[8] = 6;
    arrayOfShort[9] = 6;
    arrayOfShort[10] = 7;
    arrayOfShort[11] = 4;
    arrayOfShort[12] = 8;
    arrayOfShort[13] = 9;
    arrayOfShort[14] = 10;
    arrayOfShort[15] = 10;
    arrayOfShort[16] = 11;
    arrayOfShort[17] = 8;
    arrayOfShort[18] = 12;
    arrayOfShort[19] = 13;
    arrayOfShort[20] = 14;
    arrayOfShort[21] = 14;
    arrayOfShort[22] = 15;
    arrayOfShort[23] = 12;
    arrayOfShort[24] = 16;
    arrayOfShort[25] = 17;
    arrayOfShort[26] = 18;
    arrayOfShort[27] = 18;
    arrayOfShort[28] = 19;
    arrayOfShort[29] = 16;
    arrayOfShort[30] = 20;
    arrayOfShort[31] = 21;
    arrayOfShort[32] = 22;
    arrayOfShort[33] = 22;
    arrayOfShort[34] = 23;
    arrayOfShort[35] = 20;
    arrayOfShort[36] = 24;
    arrayOfShort[37] = 25;
    arrayOfShort[38] = 26;
    arrayOfShort[39] = 26;
    arrayOfShort[40] = 27;
    arrayOfShort[41] = 24;
    arrayOfShort[42] = 28;
    arrayOfShort[43] = 29;
    arrayOfShort[44] = 30;
    arrayOfShort[45] = 30;
    arrayOfShort[46] = 31;
    arrayOfShort[47] = 28;
    arrayOfShort[48] = 32;
    arrayOfShort[49] = 33;
    arrayOfShort[50] = 34;
    arrayOfShort[51] = 34;
    arrayOfShort[52] = 35;
    arrayOfShort[53] = 32;
    arrayOfShort[54] = 36;
    arrayOfShort[55] = 37;
    arrayOfShort[56] = 38;
    arrayOfShort[57] = 38;
    arrayOfShort[58] = 39;
    arrayOfShort[59] = 36;
    float[] arrayOfFloat2 = { 0.5F, 0.1F, 0.0F, 0.1F, 0.0F, 0.0F, 0.5F, 0.0F, 0.5F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F, 0.0F, 0.0F, 0.1F, 0.0F, 0.1F, 1.0F, 0.0F, 1.0F, 0.0F, 1.0F, 0.0F, 0.9F, 0.5F, 0.9F, 0.5F, 1.0F, 0.5F, 0.0F, 0.5F, 1.0F, 0.4F, 1.0F, 0.4F, 0.0F, 1.0F, 0.1F, 0.5F, 0.1F, 0.5F, 0.0F, 1.0F, 0.0F, 1.0F, 0.0F, 0.5F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F, 0.5F, 0.0F, 0.6F, 0.0F, 0.6F, 1.0F, 0.5F, 1.0F, 0.5F, 1.0F, 0.5F, 0.9F, 1.0F, 0.9F, 1.0F, 1.0F, 1.0F, 0.0F, 1.0F, 1.0F, 0.9F, 1.0F, 0.9F, 0.0F };
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
  
  float[] concat(float[] paramArrayOfFloat1, float[] paramArrayOfFloat2)
  {
    int i = paramArrayOfFloat1.length;
    int j = paramArrayOfFloat2.length;
    float[] arrayOfFloat = new float[i + j];
    System.arraycopy(paramArrayOfFloat1, 0, arrayOfFloat, 0, i);
    System.arraycopy(paramArrayOfFloat2, 0, arrayOfFloat, i, j);
    return arrayOfFloat;
  }
  
  protected void generateMono()
  {
    if (this.mAmbilight)
    {
      generatePlaneMonoAmbilight();
      return;
    }
    generatePlaneMono();
  }
  
  protected void generateOverUnder()
  {
    if (this.mAmbilight)
    {
      generatePlaneOverUnderAmbilight();
      return;
    }
    generatePlaneOverUnder();
  }
  
  protected void generatePlaneOverUnderAmbilight()
  {
    float[] arrayOfFloat1 = genVerticesStereo(65536.0F);
    short[] arrayOfShort = new short[60];
    arrayOfShort[1] = 1;
    arrayOfShort[2] = 2;
    arrayOfShort[3] = 2;
    arrayOfShort[4] = 3;
    arrayOfShort[6] = 4;
    arrayOfShort[7] = 5;
    arrayOfShort[8] = 6;
    arrayOfShort[9] = 6;
    arrayOfShort[10] = 7;
    arrayOfShort[11] = 4;
    arrayOfShort[12] = 8;
    arrayOfShort[13] = 9;
    arrayOfShort[14] = 10;
    arrayOfShort[15] = 10;
    arrayOfShort[16] = 11;
    arrayOfShort[17] = 8;
    arrayOfShort[18] = 12;
    arrayOfShort[19] = 13;
    arrayOfShort[20] = 14;
    arrayOfShort[21] = 14;
    arrayOfShort[22] = 15;
    arrayOfShort[23] = 12;
    arrayOfShort[24] = 16;
    arrayOfShort[25] = 17;
    arrayOfShort[26] = 18;
    arrayOfShort[27] = 18;
    arrayOfShort[28] = 19;
    arrayOfShort[29] = 16;
    arrayOfShort[30] = 20;
    arrayOfShort[31] = 21;
    arrayOfShort[32] = 22;
    arrayOfShort[33] = 22;
    arrayOfShort[34] = 23;
    arrayOfShort[35] = 20;
    arrayOfShort[36] = 24;
    arrayOfShort[37] = 25;
    arrayOfShort[38] = 26;
    arrayOfShort[39] = 26;
    arrayOfShort[40] = 27;
    arrayOfShort[41] = 24;
    arrayOfShort[42] = 28;
    arrayOfShort[43] = 29;
    arrayOfShort[44] = 30;
    arrayOfShort[45] = 30;
    arrayOfShort[46] = 31;
    arrayOfShort[47] = 28;
    arrayOfShort[48] = 32;
    arrayOfShort[49] = 33;
    arrayOfShort[50] = 34;
    arrayOfShort[51] = 34;
    arrayOfShort[52] = 35;
    arrayOfShort[53] = 32;
    arrayOfShort[54] = 36;
    arrayOfShort[55] = 37;
    arrayOfShort[56] = 38;
    arrayOfShort[57] = 38;
    arrayOfShort[58] = 39;
    arrayOfShort[59] = 36;
    float[] arrayOfFloat2 = { 1.0F, 0.6F, 0.0F, 0.6F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F, 0.5F, 0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, 0.5F, 0.1F, 0.5F, 0.1F, 1.0F, 0.0F, 1.0F, 0.0F, 1.0F, 0.0F, 0.9F, 1.0F, 0.9F, 1.0F, 1.0F, 1.0F, 0.5F, 1.0F, 1.0F, 0.9F, 1.0F, 0.9F, 0.5F, 1.0F, 0.1F, 0.0F, 0.1F, 0.0F, 0.0F, 1.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 0.0F, 0.0F, 0.1F, 0.0F, 0.1F, 0.5F, 0.0F, 0.5F, 0.0F, 0.5F, 0.0F, 0.4F, 1.0F, 0.4F, 1.0F, 0.5F, 1.0F, 0.0F, 1.0F, 0.5F, 0.9F, 0.5F, 0.9F, 0.0F };
    mVertices = arrayOfFloat1;
    mIndices = arrayOfShort;
    mUV = arrayOfFloat2;
  }
  
  protected void generateSideBySide()
  {
    if (this.mAmbilight)
    {
      generatePlaneSideBySideAmbilight();
      return;
    }
    generatePlaneSideBySide();
  }
}
